home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
United Public Domain Gold 2
/
United Public Domain Gold 2.iso
/
utilities
/
pu005.dms
/
pu005.adf
/
Morse Code
/
morse2.0
< prev
next >
Wrap
Text File
|
1988-01-19
|
8KB
|
140 lines
REM REV 1.0 PROGRAM FOR MORSE CODE GENERATION. AUG/86 KMW. PTL.
' REV 2.0 NUMBERS ADDED 1/87 Kathy Wehr WB3KRN (@ K3RLI for packet mail)
' Public Domain Notice: This is FREE ! Don't charge anyone for this
' program. If you are a Amateur Radio Operator, send a note with your
' name, call, & address to Kathy Wehr, RD#1 Box 193, Watsontown, PA
' 17777 to get receive Amigan Beacon Newsletter, and get info on
' AmigaNet, the Low Band Amigan Amateurs Net. If you have comments
' or improvements to this program, send them to the above address.
' I especially welcome comments on how to get the code speed more
' accurate.
CLEAR
RANDOMIZE TIMER
WIDTH 77
TOTAL=.0000001#:WRONG=.0000001#
PRINT" MORSE CODE GENERATOR.":PRINT :PRINT
CHANGE:
INPUT"ENTER PITCH OF TONE.(800HZ DEFAULT)";P$
IF P$="" THEN P$="800"
P=VAL(P$)
PRINT :INPUT"ENTER CODE SPEED. WORDS/MINUTE.";WPM$
IF WPM$="" THEN WPM$="7"
WPM=VAL(WPM$)
DOT=(14.7/WPM) 'CALCULATE SPEED, DOT TIME
'PRINT:INPUT"ENTER WEIGHT (3.0 TO 1 DEFAULT).";W$
'IF W$="" THEN W$="3.0"
W$="3.0"
W=VAL(W$):DASH=DOT*W
PRINT:INPUT"DO YOU WANT NUMBERS & PUNCTUATION ? (Y)/N ";NP$
IF NP$="" THEN NP$="Y"
IF NP$="n" THEN NP$="N"
IF NP$="y" THEN NP$="Y"
CHOOSE:
CLS
PRINT" ENTER:"
PRINT" C TO CHANGE SPEED, PITCH, & PUNCTUATION."
PRINT" K FOR KEYBOARD SENDING."
PRINT" Q FOR RECEIVING QUIZ."
PRINT" R FOR RANDOM RECEIVING PRACTICE."
PRINT" S FOR RETURNING TO AMIGADOS."
INPUT R$:R$=UCASE$(R$)
IF R$="C" THEN GOTO CHANGE
IF R$="Q" THEN PRINT :PRINT "PRESS ESCAPE KEY TO FOR MENU.":GOTO QUIZ
IF R$="R" THEN PRINT:PRINT"PRESS ESCAPE KEY FOR MENU.":GOTO RAND
IF R$="S" THEN SYSTEM
IF R$="K" THEN PRINT :PRINT "START TYPING. PRESS ESCAPE FOR MENU.":GOTO GETAKEY
GOTO CHOOSE
GETAKEY:
C$=INKEY$
IF C$="" THEN GOTO GETAKEY
SOUND P,DASH,0 'WAIT ONE DOT LENGHT.
PRINT C$;:C=ASC(C$):IF C=27 THEN GOTO CHOOSE
GOSUB B
GOTO GETAKEY
RAND:
'C IS THE RANDOM CHARACTER VARIABLE, C$ IS THE LETTER.
IF NP$="Y" THEN C=((INT(RND*47))+44) ELSE C=((INT(RND*26))+65)
I=I+1:PRINT CHR$(C);:IF I=5 THEN PRINT" ":I=0
GOSUB B
SOUND P,DASH,0 'WAIT ONE DOT LENGHT.
IF I=0 THEN SOUND P,(DASH*2.4),0
AN$=UCASE$(INKEY$)
IF AN$="" THEN GOTO RAND ELSE AN=ASC(AN$):IF AN=27 THEN GOTO CHOOSE
GOTO RAND
QUIZ:
LOCATE 23,1:PRINT"SCORE = ";:PRINT USING "##.##";((100*((TOTAL-WRONG)/TOTAL)));
IF NP$="Y" THEN C=((INT(RND*47))+44) ELSE C=((INT(RND*26))+65) ', - Z (44 - 90)
C$=CHR$(C)
SEND:
TOTAL=TOTAL+1
GOSUB B
ANSWER:
AN$=UCASE$(INKEY$)
IF AN$="" THEN GOTO ANSWER
AN=ASC(AN$):IF AN=27 THEN GOTO CHOOSE
POSITION=(1+(TOTAL-((TOTAL\80)*80)))
LOCATE 12,POSITION:PRINT AN$;:IF POSITION=80 THEN LOCATE 12,1:PRINT
IF AN$<>C$ THEN WRONG=WRONG+1:GOTO SEND
GOTO QUIZ
STOP
B:
IF C=44 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:RETURN
IF C=45 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:RETURN
IF C=46 THEN SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:RETURN
IF C=47 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
IF C=48 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:RETURN
IF C=49 THEN SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:RETURN
IF C=50 THEN SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:RETURN
IF C=51 THEN SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:RETURN
IF C=52 THEN SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:RETURN
IF C=53 THEN SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
IF C=54 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
IF C=55 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
IF C=56 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
IF C=57 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
IF C=58 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
IF C=59 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
IF C=60 THEN RETURN '60=<
IF C=61 THEN RETURN ' 61==
IF C=62 THEN RETURN ' 62=>
IF C=63 THEN SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
IF C=64 THEN RETURN ' 64=@
IF C=65 THEN SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:RETURN
IF C=66 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
IF C=67 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
IF C=68 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
IF C=69 THEN SOUND P,DOT,255:RETURN
IF C=70 THEN SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
IF C=71 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
'72=H
IF C=72 THEN SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
IF C=73 THEN SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
IF C=74 THEN SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:RETURN
IF C=75 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:RETURN
IF C=76 THEN SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
IF C=77 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:RETURN
IF C=78 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
IF C=79 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:RETURN
IF C=80 THEN SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
IF C=81 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:RETURN
IF C=82 THEN SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
IF C=83 THEN SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
IF C=84 THEN SOUND P,DASH,255:RETURN
IF C=85 THEN SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:RETURN
IF C=86 THEN SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:RETURN
IF C=87 THEN SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:RETURN
IF C=88 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:RETURN
IF C=89 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:RETURN
IF C=90 THEN SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DASH,255:SOUND P,DOT,0:SOUND P,DOT,255:SOUND P,DOT,0:SOUND P,DOT,255:RETURN
RETURN
GOTO CHOOSE
STOP
END